import { request } from '@/utils/request';
import Api from '@/core/permission/modules/site/siteManagement';

/**
 * @description 获取场所数据列表
 */
export function getSitePageList(data: API.SitePageList) {
  return request({
    url: Api.pageList,
    method: 'post',
    data,
  });
}

/**
 * @description 获取场所名称列表
 */
export function getSiteNameList(query?: { placeName: string }) {
  return request({
    url: Api.nameList,
    method: 'get',
    params: query,
  });
}

/**
 * @description 根据场所名称查询场所
 */
export function getSiteSelByName(query?: { name: string }) {
  return request(
    {
      url: Api.selByName,
      method: 'get',
      params: query,
    },
    {
      isGetDataDirectly: false,
    },
  );
}

/**
 * @description 根据id查询场所
 */
export function getPlaceInfo(id) {
  return request({
    url: Api.info + `/${id}`,
    method: 'get',
  });
}

/**
 * @description 查询消防监督检查记录
 */
export function getXfjdjcList(data: API.SiteXfjdjlList) {
  return request({
    url: Api.xfjdjcList,
    method: 'post',
    data,
  });
}

/**
 * @description 查询日常巡查记录
 */
export function getRcxfjcList(data: API.SiteXfjdjlList) {
  return request({
    url: Api.rcxfjcList,
    method: 'post',
    data,
  });
}

/**
 * @description 查询立案记录
 */
export function getKyjcrwList(data: API.SiteXfjdjlList) {
  return request({
    url: Api.kyjcrwList,
    method: 'post',
    data,
  });
}
